import { createApp } from 'vue'
import App from './App.vue'
import { createPinia } from 'pinia';
import ElementPlus from 'element-plus'
import 'element-plus/theme-chalk/index.css'
import locale from 'element-plus/es/locale/lang/zh-cn'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import router from './router/index.ts'
import request from '@/request/index.js'

import DataVVue3 from '@kjgl77/datav-vue3'
// import '@/assets/styles/index.scss' // global css

// 分页组件
import Pagination from '@/components/Pagination'
// 卡片
import BaseCard from '@/components/BaseCard'

// 大屏卡片
import BaseCardBaseCard from '@/components/BaseCard/BaseCard'


const app = createApp(App)


import WS from "@/utils/websocket";

const pinia = createPinia(); 


for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.config.globalProperties.$request = request

app.config.globalProperties.$WS = WS

app.component('BaseCard', BaseCard)
app.component('Pagination', Pagination)
app.component('BaseCardBaseCard', BaseCardBaseCard)

app.use(router)
app.use(pinia); 
app.use(ElementPlus, { locale })
app.use(DataVVue3)
app.mount('#app')
